//
//  HuoQuDianPuSheZhi.m
//  EJLX
//
//  Created by xufei on 15/12/14.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "HuoQuDianPuSheZhi.h"

@implementation HuoQuDianPuSheZhi
+(id)userWithDictionary:(NSDictionary*)userDic
{
    return [[self alloc]initWithDictionary:userDic];
}
-(id)initWithDictionary:(NSDictionary*)userDic
{
    self=[super init];
    if (self)
    {
        
        _username=[userDic[@"username"]copy];
        
        
         _avatar=[userDic[@"avatar"]copy];
       
        
       _addressphone=[userDic[@"address"][@"phone"]copy];
        _Id=[userDic[@"address"][@"id"]intValue];
        
        
        _defaultAdd=userDic[@"address"][@"defaultAdd"];
        
//        if (<#condition#>) {
//            <#statements#>
//        }
        if ([userDic[@"signboard"]isKindOfClass:[NSNull class]])
        {
            _signboard=@"";
        }
        else
        {
             _signboard=[userDic[@"signboard"]copy];
        }
        if ([userDic[@"wechat"]isKindOfClass:[NSNull class]])
        {
            _wechat=0;
        }
        else
        {
            _wechat=[userDic[@"wechat"]copy];
        }
        if ([userDic[@"address"][@"name"]isKindOfClass:[NSNull class]])
        {
            _addressname=@"";
        }
        else
        {
            _addressname=[userDic[@"address"][@"name"]copy];
        }
        if ([userDic[@"signboard"]isKindOfClass:[NSNull class]])
        {
            _signboard=@"";
        }
        if ([userDic[@"closeminute"]isKindOfClass:[NSNull class]])
        {
            _closeminute=0;
            
            
        }else{
            _closeminute=[userDic[@"closeminute"]intValue];


        }
        
        if ([userDic[@"name"]isKindOfClass:[NSNull class]])
        {
            _name=@"";
        }
        else
        {
            _name=[userDic[@"name"]copy];
        }
        if ([userDic[@"url"]isKindOfClass:[NSNull class]])
        {
            _url=@"";
        }
        else
        {
             _url=[userDic[@"url"]copy];
        }
        if ([userDic[@"phone"]isKindOfClass:[NSNull class]])
        {
            _phone=@"";
        }
        else
        {
             _phone=[userDic[@"phone"]copy];
        }
        
        
    }
    return self;
}

@end
